import {
    Action
} from 'redux';

const initState = {
    plans: {},
    consumablePlans:{}
}

import * as types from './../types/iap';

export default (state = initState, action: Action) => {
    const {
        type,
        data
    } = action;

    switch (type) {
        case types.getGoldPlans : {
            state.plans = {...data};
            return {
                ...state
            }
        }

        case types.getConsumablePlans : {
            state.consumablePlans = {...data};
            return {
                ...state
            }
        }
    }
    return state;
}